package com.qms.repast.ui.activity;

import android.content.Intent;
import android.widget.ImageView;
import android.widget.ScrollView;
import android.widget.TextView;

import com.qms.repast.R;
import com.qms.repast.entity.reqbean.ReqDishesInfo;
import com.qms.repast.entity.resbean.DishesInfo;
import com.qms.repast.ui.base.BaseActivity;
import com.qms.repast.ui.presenter.CuisineInfoPresenter;
import com.qms.repast.ui.view.ICuisineInfoView;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * @author 泅渡者
 * @date 2018/9/20 0020
 * @describe: 菜品信息界面  建议网页加载
 */
public class CuisineInfoActivity extends BaseActivity<CuisineInfoPresenter> implements ICuisineInfoView {
	@BindView(R.id.iv_delete)
	ImageView ivDelete;
	@BindView(R.id.iv_image)
	ImageView ivImage;
	@BindView(R.id.tv_cuisineName)
	TextView tvCuisineName;
	@BindView(R.id.tv_price)
	TextView tvPrice;
	@BindView(R.id.tv_desc)
	TextView tvDesc;
	@BindView(R.id.tv_burdening)
	TextView tvBurdening;
	@BindView(R.id.recyclerview)
	ScrollView recyclerview;
	@BindView(R.id.refreshLayout)
	SmartRefreshLayout refreshLayout;

	private String shopId;
	private String userId;
	private String itemId;

	@Override
	protected int initLayout () {
		return R.layout.activity_cuisine_info;
	}

	@Override
	protected void initPresenter (Intent intent) {
		mPresenter = new CuisineInfoPresenter(this, this);
		shopId = intent.getStringExtra("shopId");
		userId = intent.getStringExtra("userId");
		itemId = intent.getStringExtra("itemId");
	}

	@Override
	protected void initView () {

	}

	@Override
	protected void initData () {
		ReqDishesInfo reqDishesInfo = new ReqDishesInfo();
		reqDishesInfo.setItemId(itemId);
		reqDishesInfo.setShopId(shopId);
		reqDishesInfo.setUserId(userId);
		mPresenter.getDishInfo(reqDishesInfo);
	}

	@OnClick(R.id.iv_delete)
	public void onViewClicked () {
		finish();
	}

	@Override
	public void updateUI (DishesInfo dishesInfo) {

	}
}
